<?php
/**
 * OrangeHRM is a comprehensive Human Resource Management (HRM) System that captures
 * all the essential functionalities required for any enterprise.
 * Copyright (C) 2006 OrangeHRM Inc., http://www.orangehrm.com
 *
 * OrangeHRM is free software; you can redistribute it and/or modify it under the terms of
 * the GNU General Public License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * OrangeHRM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with this program;
 * if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA  02110-1301, USA
 *
 */
if(isset($records['messageType'])) {
if ($records['messageType'] == 'SUCCESS') {
	$records['message'] = $lang_Time_AttendanceConfigSaving_SUCCESS;
} elseif ($records['messageType'] == 'FAILURE') {
	$records['message'] = $lang_Time_AttendanceConfigSaving_FAILURE;
} else {
	$records['message'] = null;
}
} else {
	$records['message'] = null;
}
?>

<div class="formpage">
    <div class="outerbox">
        <div class="mainHeading"><h2>导入原始考勤数据</h2></div>
        <?php if (isset($records['message'])) { ?>
            <div class="messagebar">
                <span class="<?php echo $records['messageType']; ?>"><?php echo $records['message']; ?></span>
            </div>
        <?php } ?>

<form action="?adcode=ExcelUpload&action=save" method="post" id="attendanceConfig" name="attendanceConfig" enctype="multipart/form-data">
<table width="580" border="0" cellpadding="4" cellspacing="0">
	<tr>
      <td colspan="3"><h4>导入规则</h4></td>
    </tr>
    <tr>
      <td colspan="3">在下面填写卡号，打卡时间，打卡机器,员工ID所在的列数（下面默认的列数是给出模板的列数）</td>
    </tr>
    
    <tr>
      <td colspan="3">第一行是否有栏目文字说明：<input name="IsMenuText" id="IsMenuText" type="checkbox" checked value=1></td>
    </tr> 
    
    <tr>
      <td align="left">打卡日期列数：<input type="text" name="RecordDate" id="RecordDate" size="1"  value="5"/></td>
      <td align="left">打卡时间列数：<input type="text" name="RecordTime" id="RecordTime" size="1"  value="6"/></td>
      <td align="left">设备编号列数：<input type="text" name="MachineNum" id="MachineNum" size="1"  value="8"/></td>
    </tr>
    <tr>
      <td align="left">人员编号列数（卡号）：<input type="text" name="EmpCardNum" id="EmpCardNum" size="1"  value="2"/></td>
      <td align="left">登记号码（员工ID）列数：<input type="text" name="EmpIdNum" id="EmpIdNum" size="1"  value="3"/></td>
      <td align="left"></td>
    </tr>
    
    <tr>
      <td colspan="3">上传EXCEL文件：<input type="file" name="upload" />&nbsp;&nbsp;&nbsp;&nbsp;<span id="uploadmsg"></span></td>
    </tr>
    <?php if(isset($records['addnum'])) { ?>
    <tr>
      <td colspan="3">这次一共上传：<font color="red"><?php echo $records['allnum']; ?></font> 条记录，成功增加：<font color="red"><?php echo $records['addnum']; ?></font> 条记录,批量添加的时间为：<font color="red"><?php echo $records['AddTime']; ?>，此时间可供删除这次批量操作导入</font></td>
    </tr>
    <?php } ?>
    
   
  </table>


    <div class="formbuttons">
        <input type="submit" class="savebutton" id="saveBtn"
            onmouseover="moverButton(this);" onmouseout="moutButton(this);"
            value="提交" />
    </div>
</form>
</div>


<div class="formpage">
    <div class="outerbox">
        <div class="mainHeading"><h2>批量删除考勤数据</h2></div>
        <?php if (isset($records['message'])) { ?>
            <div class="messagebar">
                <span class="<?php echo $records['messageType']; ?>"><?php echo $records['message']; ?></span>
            </div>
        <?php } ?>

<form action="?adcode=ExcelUpload&action=DeleteMode" method="post" id="attendanceConfig" name="attendanceConfig">
<table width="580" border="0" cellpadding="4" cellspacing="0">
	<tr>
      <td colspan="4"><h4>批量删除某时刻导入的数据(输入如下：)</h4></td>
    </tr>
    
    <tr>
      <td colspan="4">填写具体时刻：<input type="text" name="AddTime" id="AddTime"   value="<?php echo (isset($_POST['AddTime']))?$_POST['AddTime']:@date("Y-m-d H:i:s");?>"/></td>
    </tr> 
    
    <?php if(isset($records['test'])) { ?>
    <tr>
      <td colspan="4"><?php echo $records['test']; ?>。这次一共删除：<font color="red"><?php echo $records['num']; ?></font> 条记录。</td>
    </tr>
    <?php } ?>
   
  </table>


    <div class="formbuttons">
        <input type="submit" class="savebutton" id="saveBtn"
            onmouseover="moverButton(this);" onmouseout="moutButton(this);"
            value="提交" />
    </div>
</form>
</div>
<script type="text/javascript">
//<![CDATA[
    if (document.getElementById && document.createElement) {
        roundBorder('outerbox');
    }
//]]>
</script>
</div>
